package com.springboot.dubbo.cluster;


import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.RpcException;
import org.apache.dubbo.rpc.cluster.Cluster;
import org.apache.dubbo.rpc.cluster.Directory;

/**
 * 自定义集群策略
 *
 * @author supu
 * @date 2019-08-07 9:48
 **/
public class CustomCluster implements Cluster {
    public final static String NAME = "custom";

    @Override
    public <T> Invoker<T> join(Directory<T> directory) throws RpcException {
        return new CustomClusterInvoker<>(directory);
    }
}
